<template>
    <div>
        <div id="slider" class="mui-slider">
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll">
						<a class="mui-control-item mui-active" href="#item1mobile" data-wid="tab-top-subpage-1.html" @click="getphotolist">
							推荐
						</a>
						<a class="mui-control-item" href="#item2mobile" data-wid="tab-top-subpage-2.html" @click="getphotolist">
							热点
						</a>
						<a class="mui-control-item" href="#item3mobile" data-wid="tab-top-subpage-3.html" @click="getphotolist">
							北京
						</a>
						<a class="mui-control-item" href="#item4mobile" data-wid="tab-top-subpage-4.html" @click="getphotolist">
							社会
						</a>
						<a class="mui-control-item" href="#item5mobile" data-wid="tab-top-subpage-5.html" @click="getphotolist">
							娱乐
						</a>
						<a class="mui-control-item" href="#item6mobile" data-wid="tab-top-subpage-6.html" @click="getphotolist">
							科技
						</a>
					</div>
						
				</div>

			</div>
				<ul class="photolist">
					<router-link v-for="item in list" :key="item.id" to="/home/photoinfo" tag="li">
						<img v-lazy="item.imgurl">
						<div class="info">
							<h1 class="infotitle">{{item.title}}</h1>
							<div class="infobody">{{item.title+item.time}}</div>
						</div>
					</router-link>
				</ul>
    </div>
</template>
<script>
//导入mui JS
import mui from "../mui/js/mui.min.js";



export default {
    data(){
        return {
			list:[]
        }
	},
	created(){
		this.getphotolist();
	},
    mounted(){
        //初始化滑动组件
        mui('.mui-scroll-wrapper').scroll({
            deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
        });
    },
    methods:{
		getphotolist(){
			this.$http.get("https://api.oioweb.cn/api/biying.php").then(result=>{
				this.list=result.body.data;
			});
		}
    }
}
</script>
<style scoped>
*{
    touch-action: none;
}
img[lazy=loading] {
  width: 40px;
  height: 300px;
  margin: auto;
}
.photolist{
	list-style: none;
	margin: 0;
	padding: 0;
	margin-bottom: 10px;
}
li{
	background-color: #ccc;
	text-align: center;
	margin-bottom: 10px;
	box-shadow: 0 0 9px #999;
	position: relative;
}
img{
	width: 100%;
	vertical-align: middle;
}
.info{
	color: #fff;
	text-align: left;
	position: absolute;
	bottom: 0;
	background-color: rgba(0,0,0,0.4);
	max-height: 84px;
}
.infotitle{
	font-size: 14px;
}
.infobody{
	font-size: 13px;
}
</style>